#include <iostream>
#include <vector>

using namespace std;

int main()
{
	vector<int> bugget(12,0);
	for(int i = 0; i <12 ;i++) cin >> bugget[i];
	
	int ret = 0;
	int ans;
	for(int i = 0; i < 12;i++)
	{
		ret += 300-bugget[i];
		if(ret <0) 
        {
            cout << '-' << i+1<<endl;
            return 0;
        }
		
		if(ret >= 100)
		{
            ans += (ret / 100) *100;
			ret = ret % 100;
		}
	}
	cout << ans*1.2 + ret <<endl;
	return 0;
} 
